window.onload = function () {
    viewBulletin();
}

var layer, table;
layui.use(['layer', 'table'], function () {
    layer = layui.layer;
    table = layui.table;
});

/**
 * 获取公告信息
 */
function viewBulletin() {
    var param = {
        bulletinId: $('#bulletinId').val()
    }
    $.ajax({
        type: "POST",
        url: "/bulletin/getBulletinById",
        //contentType: "application/json",
        sync: true,
        data: param,
        dataType: "json",
        success: function (result) {
            if (result.code == 200) {
                var bulletin = result.data;
                $("#bulletinTitle").empty().append(bulletin.bulletinTitle);
                $("#bulletinContent").empty().append(bulletin.bulletinContent);
            } else {
                $("#bulletinContent").empty().append('<p>该公告不存在！<p/>');
                console.log("该公告不存在！")
            }
        }
    });
}